/*************************************************************************
	> File Name: test.c
	> Author: H.M. Lau
	> Mail: hm.lau@outlook.com
	> Created Time: 2023/08/26 21:03
 ************************************************************************/

#include <stdio.h>

#define ONE 0x1
#define TWO 0x2
#define THREE 0x4

void show(int flag) {
    if (flag & ONE) printf("hello one\n");
    if (flag & TWO) printf("hello two\n");
    if (flag & THREE) printf("hello three\n");
}

int main() {
    printf("-----------------------------------\n");
    show(ONE);
    printf("-----------------------------------\n");
    show(TWO);
    printf("-----------------------------------\n");
    show(THREE);
    printf("-----------------------------------\n");
    show(ONE | TWO);
    printf("-----------------------------------\n");
    show(TWO | THREE);
    printf("-----------------------------------\n");
    show(ONE | TWO | THREE);
    printf("-----------------------------------\n");
    return 0;
}
